package mattkrutsick.android.fitnesstracker;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class CreateWorkoutActivity extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
	Button Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Back;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.createworkout);
        
        
     //Create instances of the 8 buttons on this screen
       findButtons();
       
      //create listeners for each of the buttons if it is clicked
        setLists();
        
    }
    
    public void onClick(View arg0) {
		// TODO Auto-generated method stub
	
		if(Monday.isPressed())
			startActivity(new Intent(CreateWorkoutActivity.this, AddExActivity.class));
		//CreateWorkoutActivity.this.finish();
		
	    if(Tuesday.isPressed())
			startActivity(new Intent(CreateWorkoutActivity.this, AddExActivity.class));
	  //CreateWorkoutActivity.this.finish();
	   
		if(Wednesday.isPressed())
			startActivity(new Intent(CreateWorkoutActivity.this, AddExActivity.class));
		//CreateWorkoutActivity.this.finish();
		
	    if(Thursday.isPressed())
			startActivity(new Intent(CreateWorkoutActivity.this, AddExActivity.class));
	  //CreateWorkoutActivity.this.finish();
	   
		if(Friday.isPressed())
			startActivity(new Intent(CreateWorkoutActivity.this, AddExActivity.class));
		//CreateWorkoutActivity.this.finish();
		
	    if(Saturday.isPressed())
			startActivity(new Intent(CreateWorkoutActivity.this, AddExActivity.class));
	  //CreateWorkoutActivity.this.finish();
	   
		if(Sunday.isPressed())
			startActivity(new Intent(CreateWorkoutActivity.this, AddExActivity.class));
		//CreateWorkoutActivity.this.finish();
		if(Back.isPressed())
			startActivity(new Intent(CreateWorkoutActivity.this, HomeScreenActivity.class));
		//CreateWorkoutActivity.this.finish();
	}
   
    
    /*
     * Sets all listeners for the buttons
     */
    private void setLists()
    {
    	Monday.setOnClickListener(this);
        Tuesday.setOnClickListener(this);
        Wednesday.setOnClickListener(this);
        Thursday.setOnClickListener(this);
        Friday.setOnClickListener(this);
        Saturday.setOnClickListener(this);
        Sunday.setOnClickListener(this);
        Back. setOnClickListener(this);
    }
    
    
    private void findButtons()
    {
    	 Monday=(Button)findViewById(R.id.btnMonday);
         Tuesday=(Button)findViewById(R.id.btnTuesday);
         Wednesday=(Button)findViewById(R.id.btnWednesday);
         Thursday=(Button)findViewById(R.id.btnThursday);
         Friday=(Button)findViewById(R.id.btnFriday);
         Saturday=(Button)findViewById(R.id.btnSaturday);
         Sunday=(Button)findViewById(R.id.btnSunday);
         Back=(Button)findViewById(R.id.btnHome);
    }

	
	
}
